from info import models
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from info import create_app, db
from config import DevelopementConfig, ProductionConfig

# 创建 app，并传入配置模式
app = create_app(DevelopementConfig)

# 创建Manager对象
manager = Manager(app)

# 创建迁移对象
Migrate(app, db)

# 给Migrate绑定迁移命令
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    manager.run()
